<?php 
/****

	If you want the best of the world,
give the world your best anytime！
            				——不二
                							
****/

defined('ACCESS')||exit('Forbidden!');

//分页类
class Pages {
	public static function getPages(){
		//当前页码$curr = 1
		//总数 $num
		//每页显示条数 $cnt
		
		//页数
		$n = ceil($num/$cnt);

		//最左,最右侧
		$left = max(1,$curr-1);
		$right = min($left+2,$n);
		$left = min($curr-1,$right-2);

		$where = '1 order by cat_id desc limit '.($curr-1)*cnt.','.$cnt;
		for($a = $left;$a <= $right;$a++){
			$_GET['page'] = $a;
			$page[$a] = http_build_query($_GET);
		}
		return $page;
	}
}

